package com.zjw.zy.componse.demo.fragment

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Surface
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.lifecycle.viewmodel.compose.viewModel
import com.zjw.zy.componse.demo.base.BaseComposeFragment
import com.zjw.zy.componse.demo.ui.theme.MyApplicationTheme
import com.zjw.zy.componse.demo.view.MineGameSurfaceView
import com.zjw.zy.componse.demo.viewmodel.MineGameViewModel

/**
 * @author     ：zhong.jw
 * @date       ：Created in 2023/3/6 11:23
 * @description：扫雷 surface版本
 */
class MineGame2Fragment : BaseComposeFragment() {
    override fun onContentView(rootView: ComposeView) {
        rootView.setContent {
            MyApplicationTheme {
                Surface(
                    modifier = Modifier.fillMaxSize()
                ) {


                    AndroidView(
                        factory = {
                            MineGameSurfaceView(it).apply {

                            }
                        },
                        modifier = Modifier
                            .fillMaxSize()
                            .padding(10.dp)
                    )

                }
            }
        }
    }

    override fun onSubscribeValue() {
    }
}